<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('薪资变动历史')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="main-content">
    <form id="form-updateSalarysxData-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <div class="row">
            <h4 class="form-header h4">输入生效日期</h4>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">生效日期：</label>
                    <div class="col-sm-8">
                        <input type="text" names="effectdate" id="effectdate" class="form-control laydate-demo-2"
                               placeholder="yyyy-MM-dd">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">选择人：</label>
                    <div class="col-sm-8">
                        <textarea name="names" id="names" class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js"/>


<script th:inline="javascript">
    var names;
    var allId;
    $(function () {

        $(".datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });

        names = [[${names}]];
        $("#names").val(names);
        allId = [[${allId}]];
    });

    function submitHandler() {
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "salaryChange/salaryChange/editEffdate",
            data: {
                "allId": allId,
                "effectdate": $("#effectdate").val()
            },
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>